// components/popup/popup.js
Component({
    /**
   * 组件的属性列表
   */
    properties: {
        title: String,
        content: String,
        confirmText: String,
        cancel: Boolean,
        list: Array
    },

    /**
   * 组件的初始数据
   */
    data: {

    },

    /**
   * 组件的方法列表
   */
    methods: {
        close(){
            this.triggerEvent('cancel')
        },
        submit() {
            const data = this.data.list
            const result = {}
            for(const i in data){
                result[data[i].key]= data[i].value
            }
            this.triggerEvent('submit',result)
        },
        inputchange(event){
            this.setData({
                ['list[' + event.currentTarget.dataset.model + '].value']: event.detail.value
            })
        }
    }
})
